
package usuario.frames;

import bibliinfo.FrameMain;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JFormattedTextField;
import javax.swing.JInternalFrame;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import javax.swing.text.MaskFormatter;
import utilitarios.Validar;

public class UserFrameDados extends javax.swing.JInternalFrame {

    public UserFrameDados() {
        initComponents();
        try{
            mascara.setMask("#####-###");
        }catch(ParseException e){
            e.printStackTrace();
        }
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jTRG = new javax.swing.JTextField();
        jTNome = new javax.swing.JTextField();
        jLSexo = new javax.swing.JLabel();
        jLNome = new javax.swing.JLabel();
        jLNumCasa = new javax.swing.JLabel();
        jLCep = new javax.swing.JLabel();
        jLCidade = new javax.swing.JLabel();
        jLBairro = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLContato = new javax.swing.JLabel();
        jCBSexo = new javax.swing.JComboBox();
        jTNumCasa = new javax.swing.JTextField();
        jTRua = new javax.swing.JTextField();
        jTCidade = new javax.swing.JTextField();
        jSeparator2 = new javax.swing.JSeparator();
        jLEndereco = new javax.swing.JLabel();
        jLDataNasc = new javax.swing.JLabel();
        jTDia = new javax.swing.JTextField();
        jLEstado = new javax.swing.JLabel();
        jLDados = new javax.swing.JLabel();
        jLRG = new javax.swing.JLabel();
        jTCep = new javax.swing.JTextField();
        jLObservacoes = new javax.swing.JLabel();
        jLTel_1 = new javax.swing.JLabel();
        jTTel_1 = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTTel_2 = new javax.swing.JTextField();
        jLTel_3 = new javax.swing.JLabel();
        jTTel_3 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jTTel_4 = new javax.swing.JTextField();
        jLEmail_1 = new javax.swing.JLabel();
        jTEmail_1 = new javax.swing.JTextField();
        jLEmail_2 = new javax.swing.JLabel();
        jTEmail_2 = new javax.swing.JTextField();
        jSeparator3 = new javax.swing.JSeparator();
        jLAdicional = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTAObs = new javax.swing.JTextArea();
        jCBEstado = new javax.swing.JComboBox();
        jDesktop = new javax.swing.JDesktopPane();
        jLRua = new javax.swing.JLabel();
        jTBairro = new javax.swing.JTextField();
        jLDataNasc1 = new javax.swing.JLabel();
        jTMes = new javax.swing.JTextField();
        jLDataNasc2 = new javax.swing.JLabel();
        jTAno = new javax.swing.JTextField();

        setPreferredSize(new java.awt.Dimension(800, 600));

        jTRG.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTRGKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTRGKeyReleased(evt);
            }
        });

        jTNome.setPreferredSize(new java.awt.Dimension(0, 10));
        jTNome.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTNomeKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTNomeKeyReleased(evt);
            }
        });

        jLSexo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLSexo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLSexo.setText("<html>Sexo:<b color=\"red\">*</b></html>");
        jLSexo.setPreferredSize(new java.awt.Dimension(20, 15));

        jLNome.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLNome.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLNome.setText("<html>Nome Completo:<b color=\"red\">*</b></html>");
        jLNome.setPreferredSize(new java.awt.Dimension(20, 15));

        jLNumCasa.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLNumCasa.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLNumCasa.setText("<html>Nº da Casa:<b color=\"red\">*</b></html>");
        jLNumCasa.setPreferredSize(new java.awt.Dimension(20, 15));

        jLCep.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLCep.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLCep.setText("<html>Cep:<b color=\"red\">*</b></html>");
        jLCep.setPreferredSize(new java.awt.Dimension(20, 15));

        jLCidade.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLCidade.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLCidade.setText("<html>Cidade:<b color=\"red\">*</b></html>");
        jLCidade.setPreferredSize(new java.awt.Dimension(20, 15));

        jLBairro.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLBairro.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLBairro.setText("<html>Bairro:<b color=\"red\">*</b></html>");
        jLBairro.setPreferredSize(new java.awt.Dimension(20, 15));

        jLContato.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLContato.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLContato.setText("Contato");
        jLContato.setPreferredSize(new java.awt.Dimension(20, 15));

        jCBSexo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jCBSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "M", "F" }));

        jTNumCasa.setPreferredSize(new java.awt.Dimension(0, 10));
        jTNumCasa.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTNumCasaKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTNumCasaKeyReleased(evt);
            }
        });

        jTRua.setPreferredSize(new java.awt.Dimension(0, 10));
        jTRua.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTRuaKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTRuaKeyReleased(evt);
            }
        });

        jTCidade.setPreferredSize(new java.awt.Dimension(0, 10));
        jTCidade.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTCidadeKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTCidadeKeyReleased(evt);
            }
        });

        jLEndereco.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLEndereco.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLEndereco.setText("Endereço");
        jLEndereco.setPreferredSize(new java.awt.Dimension(20, 15));

        jLDataNasc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLDataNasc.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLDataNasc.setText("/");
        jLDataNasc.setPreferredSize(new java.awt.Dimension(20, 15));

        jTDia.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTDiaKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTDiaKeyReleased(evt);
            }
        });

        jLEstado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLEstado.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLEstado.setText("<html>Estado:<b color=\"red\">*</b></html>");
        jLEstado.setPreferredSize(new java.awt.Dimension(20, 15));

        jLDados.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLDados.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLDados.setText("Dados Pessoais");
        jLDados.setPreferredSize(new java.awt.Dimension(20, 15));

        jLRG.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLRG.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLRG.setText("<html>RG:<b color=\"red\">*</b></html>");
        jLRG.setPreferredSize(new java.awt.Dimension(20, 15));

        jTCep.setPreferredSize(new java.awt.Dimension(0, 10));
        jTCep.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTCepKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTCepKeyReleased(evt);
            }
        });

        jLObservacoes.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLObservacoes.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLObservacoes.setText("Observações:");
        jLObservacoes.setPreferredSize(new java.awt.Dimension(20, 15));

        jLTel_1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLTel_1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLTel_1.setText("Telefone 1:");
        jLTel_1.setPreferredSize(new java.awt.Dimension(20, 15));

        jTTel_1.setPreferredSize(new java.awt.Dimension(0, 10));
        jTTel_1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTTel_1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTTel_1KeyReleased(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel12.setText("Telefone 2:");
        jLabel12.setPreferredSize(new java.awt.Dimension(20, 15));

        jTTel_2.setPreferredSize(new java.awt.Dimension(0, 10));
        jTTel_2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTTel_2KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTTel_2KeyReleased(evt);
            }
        });

        jLTel_3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLTel_3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLTel_3.setText("Telefone 3:");
        jLTel_3.setPreferredSize(new java.awt.Dimension(20, 15));

        jTTel_3.setPreferredSize(new java.awt.Dimension(0, 10));
        jTTel_3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTTel_3KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTTel_3KeyReleased(evt);
            }
        });

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel14.setText("Telefone 4:");
        jLabel14.setPreferredSize(new java.awt.Dimension(20, 15));

        jTTel_4.setPreferredSize(new java.awt.Dimension(0, 10));
        jTTel_4.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTTel_4KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTTel_4KeyReleased(evt);
            }
        });

        jLEmail_1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLEmail_1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLEmail_1.setText("E-mail 1:");
        jLEmail_1.setPreferredSize(new java.awt.Dimension(20, 15));

        jTEmail_1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTEmail_1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTEmail_1KeyReleased(evt);
            }
        });

        jLEmail_2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLEmail_2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLEmail_2.setText("E-mail 2:");
        jLEmail_2.setPreferredSize(new java.awt.Dimension(20, 15));

        jTEmail_2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTEmail_2KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTEmail_2KeyReleased(evt);
            }
        });

        jLAdicional.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLAdicional.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLAdicional.setText("Adicional");
        jLAdicional.setPreferredSize(new java.awt.Dimension(20, 15));

        jTAObs.setColumns(20);
        jTAObs.setRows(5);
        jTAObs.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTAObsKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTAObsKeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(jTAObs);

        jCBEstado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jCBEstado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" }));

        jDesktop.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                jDesktopAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        jLRua.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLRua.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLRua.setText("<html>Rua:<b color=\"red\">*</b></html>");
        jLRua.setPreferredSize(new java.awt.Dimension(20, 15));

        jTBairro.setPreferredSize(new java.awt.Dimension(0, 10));
        jTBairro.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTBairroKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTBairroKeyReleased(evt);
            }
        });

        jLDataNasc1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLDataNasc1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLDataNasc1.setText("<html>Data de Nascimento:<b color=\"red\">*</b></html>");
        jLDataNasc1.setPreferredSize(new java.awt.Dimension(20, 15));

        jTMes.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTMesKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTMesKeyReleased(evt);
            }
        });

        jLDataNasc2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLDataNasc2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLDataNasc2.setText("/");
        jLDataNasc2.setPreferredSize(new java.awt.Dimension(20, 15));

        jTAno.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTAnoKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTAnoKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
            .addComponent(jSeparator2)
            .addComponent(jSeparator3)
            .addComponent(jDesktop)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLEmail_1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTEmail_1))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLTel_1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTTel_1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLTel_3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTTel_3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTTel_2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTTel_4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLEmail_2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTEmail_2, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLRG, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTRG, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLDataNasc1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTDia, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLDataNasc, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTMes, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLDataNasc2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTAno, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLNome, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jCBSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLDados, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLContato, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jCBEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addGap(70, 70, 70))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLAdicional, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLObservacoes, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 426, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLRua, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTRua, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLNumCasa, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTNumCasa, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLCep, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTCep, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTBairro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jTCidade, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGap(0, 12, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLDados, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(9, 9, 9)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTDia, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLRG, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTRG, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLDataNasc, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLDataNasc1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTMes, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLDataNasc2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTAno, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLNome, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jCBSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jCBEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLCep, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTCep, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTRua, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTNumCasa, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLNumCasa, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLRua, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLContato, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLTel_1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTTel_1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTTel_2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLTel_3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTTel_3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTTel_4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLEmail_1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTEmail_1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLEmail_2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTEmail_2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLAdicional, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLObservacoes, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jDesktop, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jDesktopAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_jDesktopAncestorAdded
        if(componente == 1){
            escolheComp("save");        
        }else if(componente == 2){
            escolheComp("edit");        
        }else if(componente == 3){
            escolheComp("update");    
        }        
    }//GEN-LAST:event_jDesktopAncestorAdded

    private void jTRGKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTRGKeyReleased
       jTRG = Validar.validaNum(jTRG, 11);
    }//GEN-LAST:event_jTRGKeyReleased

    private void jTRGKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTRGKeyPressed
        jTRG = Validar.validaNum(jTRG, 11);
    }//GEN-LAST:event_jTRGKeyPressed

    private void jTDiaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTDiaKeyPressed
        jTDia = Validar.validaNum(jTDia, 2);
    }//GEN-LAST:event_jTDiaKeyPressed

    private void jTDiaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTDiaKeyReleased
        jTDia = Validar.validaNum(jTDia, 2);
    }//GEN-LAST:event_jTDiaKeyReleased

    private void jTMesKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTMesKeyPressed
        jTMes = Validar.validaNum(jTMes, 2);
    }//GEN-LAST:event_jTMesKeyPressed

    private void jTMesKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTMesKeyReleased
        jTMes = Validar.validaNum(jTMes, 2);
    }//GEN-LAST:event_jTMesKeyReleased

    private void jTAnoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTAnoKeyPressed
        jTAno = Validar.validaNum(jTAno, 4);
    }//GEN-LAST:event_jTAnoKeyPressed

    private void jTAnoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTAnoKeyReleased
        jTAno = Validar.validaNum(jTAno, 4);
    }//GEN-LAST:event_jTAnoKeyReleased

    private void jTNomeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTNomeKeyPressed
        jTNome = Validar.validaTexto(jTNome, 50);
    }//GEN-LAST:event_jTNomeKeyPressed

    private void jTNomeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTNomeKeyReleased
       jTNome = Validar.validaTexto(jTNome, 50);
    }//GEN-LAST:event_jTNomeKeyReleased

    private void jTCidadeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTCidadeKeyPressed
        jTCidade = Validar.validaTexto(jTCidade, 50);
    }//GEN-LAST:event_jTCidadeKeyPressed

    private void jTCidadeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTCidadeKeyReleased
        jTCidade = Validar.validaTexto(jTCidade, 50);
    }//GEN-LAST:event_jTCidadeKeyReleased

    private void jTBairroKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTBairroKeyPressed
        jTBairro = Validar.validaTexto(jTBairro, 50);
    }//GEN-LAST:event_jTBairroKeyPressed

    private void jTBairroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTBairroKeyReleased
        jTBairro = Validar.validaTexto(jTBairro, 50);
    }//GEN-LAST:event_jTBairroKeyReleased

    private void jTRuaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTRuaKeyPressed
        jTRua = Validar.validaTexto(jTRua, 50);
    }//GEN-LAST:event_jTRuaKeyPressed

    private void jTRuaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTRuaKeyReleased
        jTRua = Validar.validaTexto(jTRua, 50);
    }//GEN-LAST:event_jTRuaKeyReleased

    private void jTNumCasaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTNumCasaKeyPressed
        jTNumCasa = Validar.validaTexto(jTNumCasa, 9);
    }//GEN-LAST:event_jTNumCasaKeyPressed

    private void jTNumCasaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTNumCasaKeyReleased
        jTNumCasa = Validar.validaTexto(jTNumCasa, 9);
    }//GEN-LAST:event_jTNumCasaKeyReleased

    private void jTTel_1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_1KeyPressed
        jTTel_1 = Validar.validaTexto(jTTel_1, 15);
    }//GEN-LAST:event_jTTel_1KeyPressed

    private void jTTel_1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_1KeyReleased
        jTTel_1 = Validar.validaTexto(jTTel_1, 15);
    }//GEN-LAST:event_jTTel_1KeyReleased

    private void jTTel_2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_2KeyPressed
        jTTel_2 = Validar.validaTexto(jTTel_2, 15);
    }//GEN-LAST:event_jTTel_2KeyPressed

    private void jTTel_2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_2KeyReleased
        jTTel_2 = Validar.validaTexto(jTTel_2, 15);
    }//GEN-LAST:event_jTTel_2KeyReleased

    private void jTTel_3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_3KeyPressed
        jTTel_3 = Validar.validaTexto(jTTel_3, 15);
    }//GEN-LAST:event_jTTel_3KeyPressed

    private void jTTel_3KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_3KeyReleased
        jTTel_3 = Validar.validaTexto(jTTel_3, 15);
    }//GEN-LAST:event_jTTel_3KeyReleased

    private void jTTel_4KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_4KeyPressed
        jTTel_4 = Validar.validaTexto(jTTel_4, 15);
    }//GEN-LAST:event_jTTel_4KeyPressed

    private void jTTel_4KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTTel_4KeyReleased
        jTTel_4 = Validar.validaTexto(jTTel_4, 15);
    }//GEN-LAST:event_jTTel_4KeyReleased

    private void jTEmail_1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTEmail_1KeyPressed
        jTEmail_1 = Validar.validaTexto(jTEmail_1, 50);
    }//GEN-LAST:event_jTEmail_1KeyPressed

    private void jTEmail_1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTEmail_1KeyReleased
        jTEmail_1 = Validar.validaTexto(jTEmail_1, 50);
    }//GEN-LAST:event_jTEmail_1KeyReleased

    private void jTEmail_2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTEmail_2KeyPressed
        jTEmail_2 = Validar.validaTexto(jTEmail_2, 50);
    }//GEN-LAST:event_jTEmail_2KeyPressed

    private void jTEmail_2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTEmail_2KeyReleased
        jTEmail_2 = Validar.validaTexto(jTEmail_2, 50);
    }//GEN-LAST:event_jTEmail_2KeyReleased

    private void jTAObsKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTAObsKeyPressed
        jTAObs = Validar.validaTexto(jTAObs, 250);
    }//GEN-LAST:event_jTAObsKeyPressed

    private void jTAObsKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTAObsKeyReleased
        jTAObs = Validar.validaTexto(jTAObs, 250);
    }//GEN-LAST:event_jTAObsKeyReleased

    private void jTCepKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTCepKeyPressed
        jTCep = Validar.validaNum(jTCep, 8);
    }//GEN-LAST:event_jTCepKeyPressed

    private void jTCepKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTCepKeyReleased
        jTCep = Validar.validaNum(jTCep, 8);
    }//GEN-LAST:event_jTCepKeyReleased

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    public javax.swing.JComboBox jCBEstado;
    public javax.swing.JComboBox jCBSexo;
    private static javax.swing.JDesktopPane jDesktop;
    private javax.swing.JLabel jLAdicional;
    private javax.swing.JLabel jLBairro;
    private javax.swing.JLabel jLCep;
    private javax.swing.JLabel jLCidade;
    private javax.swing.JLabel jLContato;
    private javax.swing.JLabel jLDados;
    private javax.swing.JLabel jLDataNasc;
    private javax.swing.JLabel jLDataNasc1;
    private javax.swing.JLabel jLDataNasc2;
    private javax.swing.JLabel jLEmail_1;
    private javax.swing.JLabel jLEmail_2;
    private javax.swing.JLabel jLEndereco;
    private javax.swing.JLabel jLEstado;
    private javax.swing.JLabel jLNome;
    private javax.swing.JLabel jLNumCasa;
    private javax.swing.JLabel jLObservacoes;
    public javax.swing.JLabel jLRG;
    private javax.swing.JLabel jLRua;
    private javax.swing.JLabel jLSexo;
    private javax.swing.JLabel jLTel_1;
    private javax.swing.JLabel jLTel_3;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    public javax.swing.JTextArea jTAObs;
    public javax.swing.JTextField jTAno;
    public javax.swing.JTextField jTBairro;
    public javax.swing.JTextField jTCep;
    public javax.swing.JTextField jTCidade;
    public javax.swing.JTextField jTDia;
    public javax.swing.JTextField jTEmail_1;
    public javax.swing.JTextField jTEmail_2;
    public javax.swing.JTextField jTMes;
    public javax.swing.JTextField jTNome;
    public javax.swing.JTextField jTNumCasa;
    public javax.swing.JTextField jTRG;
    public javax.swing.JTextField jTRua;
    public javax.swing.JTextField jTTel_1;
    public javax.swing.JTextField jTTel_2;
    public javax.swing.JTextField jTTel_3;
    public javax.swing.JTextField jTTel_4;
    // End of variables declaration//GEN-END:variables
    //atributos
    private static boolean estado;
    public static Map<String, JInternalFrame> mapa = new HashMap<String, JInternalFrame>();
    private int componente;
    private long rgAntigo;
    public MaskFormatter mascara = new MaskFormatter();
    //métodos
    public void setRgAntigo(long rg){
        this.rgAntigo = rg;
    }
    public long getRgAntigo(){
        return this.rgAntigo;
    }
    public void setEstado(boolean estado){
        this.estado = estado;
    }
    public boolean getEstado(){
        return estado;
    }
    
    //encapsulando o componente
    public void setComponente(int i){
        this.componente = i;
    }
    public int getComponente(){
        return this.componente;
    }
    /**
     método usado para formatar os internalFrames chamados dentro deste
     */
    
    public static void fortama(int a){
        //retirando bordas do internalJframe
        ((BasicInternalFrameUI)mapa.get("frame"+a).getUI()).setNorthPane(null);
        mapa.get("frame"+a).setBorder(null);
        //pegando dimenções do JDesktop no qual ele esta encapsulado
        mapa.get("frame"+a).setBounds(0, 0, jDesktop.getWidth(), jDesktop.getHeight());
        mapa.get("frame"+a).setResizable(false); 
    }    
    /**
      método que me informara qual sera o internalFrame de complemento que eu usarei
     */
    public void escolheComp(String frame){
    
        if(frame.equalsIgnoreCase("save") == true){
            usuario.control.UserFrameDadosSave frameSalve = new usuario.control.UserFrameDadosSave();       
            jDesktop.add(frameSalve);
            frameSalve.show();
            mapa.put("frame1", frameSalve);
            fortama(1);     
        }else if (frame.equalsIgnoreCase("edit") == true){
            usuario.control.UserFameDadosEdit frameEdit = new usuario.control.UserFameDadosEdit();
            jDesktop.add(frameEdit);
            frameEdit.show();
            mapa.put("frame2", frameEdit);
            fortama(2);            
        }else if(frame.equalsIgnoreCase("update") == true){
            usuario.control.UserFrameDadosUpdate frameUpdate = new usuario.control.UserFrameDadosUpdate();
            jDesktop.add(frameUpdate);
            frameUpdate.show();
            mapa.put("frame3", frameUpdate);
            fortama(3);
        }        
    }
    
    public void desabilitaCampos(){
        //userFrameDados
        this.jTRG.setEditable(false);
        this.jTNome.setEditable(false);
        this.jTAObs.setEditable(false);
        this.jTDia.setEditable(false);
        this.jTMes.setEditable(false);
        this.jTAno.setEditable(false);
        this.jCBSexo.setEnabled(false);
        
        this.jCBEstado.setEnabled(false);
        this.jTCidade.setEditable(false);
        this.jTCep.setEditable(false);
        this.jTBairro.setEditable(false);
        this.jTRua.setEditable(false);
        this.jTNumCasa.setEditable(false);
        
        this.jTTel_1.setEditable(false);
        this.jTTel_2.setEditable(false);
        this.jTTel_3.setEditable(false);
        this.jTTel_4.setEditable(false);
        this.jTEmail_1.setEditable(false);
        this.jTEmail_2.setEditable(false);
        
        //userFrameadd  
        FrameMain.userFrameAdd.jTDataCadDia.setEditable(false);
        FrameMain.userFrameAdd.jTDataCadMes.setEditable(false);
        FrameMain.userFrameAdd.jTDataCadAno.setEditable(false);
        
        FrameMain.userFrameAdd.jRBNao.setEnabled(false);
        FrameMain.userFrameAdd.jRBSim.setEnabled(false);
        
        FrameMain.userFrameAdd.jTDataInicioDia.setEditable(false);
        FrameMain.userFrameAdd.jTDataInicioMes.setEditable(false);
        FrameMain.userFrameAdd.jTDataInicioAno.setEditable(false);
        
        FrameMain.userFrameAdd.jTDataFimDia.setEditable(false);
        FrameMain.userFrameAdd.jTDataFimMes.setEditable(false);
        FrameMain.userFrameAdd.jTDataFimAno.setEditable(false);              
        
        FrameMain.userFrameAdd.jTLivros.setEnabled(false);
        FrameMain.userFrameAdd.jBexcluir.jBExcluir.setEnabled(false);
        FrameMain.userFrameAdd.jBrestaurar.jBRestaurar.setEnabled(false);
        
    }
    
    public void habilitaCampos(){
        //userFrameDados
        this.jTRG.setEditable(true);
        this.jTNome.setEditable(true);
        this.jTAObs.setEditable(true);
        this.jTDia.setEditable(true);
        this.jTMes.setEditable(true);
        this.jTAno.setEditable(true);
        this.jCBSexo.setEnabled(true);
        
        this.jCBEstado.setEnabled(true);
        this.jTCidade.setEditable(true);
        this.jTCep.setEditable(true);
        this.jTBairro.setEditable(true);
        this.jTRua.setEditable(true);
        this.jTNumCasa.setEditable(true);
        
        this.jTTel_1.setEditable(true);
        this.jTTel_2.setEditable(true);
        this.jTTel_3.setEditable(true);
        this.jTTel_4.setEditable(true);
        this.jTEmail_1.setEditable(true);
        this.jTEmail_2.setEditable(true);
        
        //userFrameadd  
        FrameMain.userFrameAdd.jTDataCadDia.setEditable(true);
        FrameMain.userFrameAdd.jTDataCadMes.setEditable(true);
        FrameMain.userFrameAdd.jTDataCadAno.setEditable(true);
        
        FrameMain.userFrameAdd.jRBNao.setEnabled(true);
        FrameMain.userFrameAdd.jRBSim.setEnabled(true);            
        
        FrameMain.userFrameAdd.jTLivros.setEnabled(false);
        FrameMain.userFrameAdd.jBexcluir.jBExcluir.setEnabled(true);
        FrameMain.userFrameAdd.jBrestaurar.jBRestaurar.setEnabled(true);
    }
}
